From: Keir Fraser Date: Sun, 1 Jun 2008 08:16:26 +0000 (+0100) Subject: x86: Fix teardown of relocated vcpu_info structures. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14207^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=893ee9de18b91c2b5dbfdae37e82d9f4a55e5739;p=xen.git x86: Fix teardown of relocated vcpu_info structures. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 1d21556204..c3522c516c 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -59,8 +59,6 @@ DEFINE_PER_CPU(unsigned long, cr4); static void default_idle(void); void (*pm_idle) (void) = default_idle; -static void unmap_vcpu_info(struct vcpu *v); - static void paravirt_ctxt_switch_from(struct vcpu *v); static void paravirt_ctxt_switch_to(struct vcpu *v); @@ -433,8 +431,6 @@ void vcpu_destroy(struct vcpu *v) if ( is_pv_32on64_vcpu(v) ) release_compat_l4(v); - unmap_vcpu_info(v); - if ( is_hvm_vcpu(v) ) hvm_vcpu_destroy(v); } @@ -1864,17 +1860,20 @@ int domain_relinquish_resources(struct domain *d) /* Tear down paging-assistance stuff. */ paging_teardown(d); - /* Drop the in-use references to page-table bases. */ for_each_vcpu ( d, v ) + { + /* Drop the in-use references to page-table bases. */ vcpu_destroy_pagetables(v); - /* - * Relinquish GDT mappings. No need for explicit unmapping of the LDT - * as it automatically gets squashed when the guest's mappings go away. - */ - for_each_vcpu(d, v) + /* + * Relinquish GDT mappings. No need for explicit unmapping of the + * LDT as it automatically gets squashed with the guest mappings. + */ destroy_gdt(v); + unmap_vcpu_info(v); + } + d->arch.relmem = RELMEM_xen_l4; /* fallthrough */